#include <iostream>
#include <string.h>
#include <queue>
using namespace std;

class Person
{
public:
	Person(int a, int b)
	{
		this->a = a;
		this->b = b;
	}
	~Person(){};
	int a, b;
	
};
int main(int argc, char const *argv[])
{
	queue<Person>q;
	Person p1(1, 2);
	Person p2(3, 4);
	Person p3(5, 6);
	q.push(p1);
	q.push(p2);
	q.push(p3);
	while(!q.empty())
	{
		cout<<q.front().a<<endl;
		cout<<q.front().b<<endl;
		cout<<q.back().a<<endl;
		cout<<q.back().b<<endl;
		q.pop();
		q.pop();
		q.pop();
	}
	cout<<"queue"<<endl;
	return 0;
}